<%@ include file="/WEB-INF/views/commonJSTL.jsp" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<html>
    <head>
    	<title>FarmaSoft</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		<%@ include file="/WEB-INF/views/commonResources.jsp" %>
		<script src="<c:url value="/resources/js/jquery.jstree.js" />"></script>	
        <script type="text/javascript">
        
       	/*Para editar Farmacia*/
       	function editCompanyPharmacy(pharmacyId){
    		location.href = "companyEdit?_menuId=3&_subMenuId=2&_optionId=1&_pharmacyId="+pharmacyId;
		}
        
	</script>
    </head>
    <body>
        <div id="top-wrap">
            <!-- cabeza principal -->
            <%@include file="../../../head.jsp" %>
            
            <!-- cuerpo -->
            <div id="bodySpace">               
                <!-- aqui va la ruta -->
                <div class="clearfix" id="middle" style="position: absolute">
                    <!-- aqui va el arbol de entrada -->
                    <div id="breadcrumb"><!-- le da la forma de la imagen -->
                        <ul>
                        <li><a href="mainFront?v=1">Home</a></li>
                        <li><span style="color:#666">Operaciones</span></li>
                          <li><span style="color:#666">Empresa</span></li>
                        <li class="current-page"><span class="end"><span class="middle">Datos Empresa</span></span></li>
                        </ul>
                        <!-- para la hora -->
                        <!--<div style="clear: both;position: absolute;text-align: right;width: 100%;"><span id="fechaServ"></span>&nbsp;&nbsp;<span id="horaServ" style=""></span>&nbsp;</div>-->
                    </div><!-- begin SIDEBAR FIRST -->
                </div>
                
                <div id="principal">
                    <!-- izquierda -->
                    <div class="cuerpo2y" style="border: 0px solid"><br/><br/><!-- estos break son necesarios ya q uso absolute en css  cuerpo izquierdo-->
                        <div class="izq">
                            <%@include file="../../../bodyIzq.jsp" %>
                        </div>                       
                       	<div class="medio" style="border: 0px solid">
                        	<h2 class="decorado" >Datos de la Empresa</h2><br/><br/><br/>
                        	
                            <form method="post" action="Operaciones" name="formEmpresa" id="formEmpresa" >
                            <c:forEach var="company" items="${ActivePharmacy}">
                            		
		                        <div style="clear:both;">
				                    <label class="form_align30" >Nombre: </label>
				                    <input  type="text" name="name" id="name" value="${company.name}" readonly  class="required form_input_align"  maxlength="40" placeholder="texto" />
				                    <label class="error">*</label>
		                        </div>
		                        <div style="clear:both;">
			                        <label class="form_align30" >Sigla: </label>
			                        <input type="text" name="initials" id="initials" value="${company.initials}"  readonly class="form_input_align lettersOnly" title="Ingrese Sigla" maxlength="5" placeholder="letras"/>
		                        	<label class="error">*</label>
		                        </div>
		                        <div style="clear:both;">
				                    <label class="form_align30" >Razon Social: </label>
				                    <input type="text" name="socialReason" id="socialReason" value="${company.socialReason}" readonly class="required form_input_align lettersOnly" title="Ingrese Razon Social" maxlength="40" placeholder="letras"/>
				                    <label class="error">*</label>
		                        </div>
		                        <div style="clear:both;">
				                    <label class="form_align30" >Nit: </label>
				                    <input type="text" name="nit" id="nit" value="${company.nit}" class="required form_input_align lettersOnly" readonly title="Ingrese Nit" maxlength="40" placeholder="letras"/>
				                    <label class="error">*</label>
		                        </div>
		                        <div style="clear:both;">
				                    <label class="form_align30" >Dirección: </label>
				                    <textarea name="address" id="address"  rows="3" cols="16" maxlength="150" readonly title="Ingrese una Direccion." >${company.address}</textarea><br/>
		                        </div>
		                        <div style="clear:both;">
				                    <label class="form_align30" >Telefono: </label>
				                    <input type="text" name="phone" id="phone" value="${company.phone}" class="required form_input_align" readonly title="Ingrese Telefono" maxlength="40" placeholder="letras"/>
		                        </div>
		                        <div style="clear:both;">
				                    <label class="form_align30" >Telefono2: </label>
				                    <input type="text" name="phoneRef" id="phoneRef" value="${company.phone2}" class="required form_input_align"  readonly title="Ingrese Telefono" maxlength="40" placeholder="letras"/>
		                        </div>
								<div style="clear:both;">
					                <label class="form_align30" >Email: </label>
					                <input type="text" name="email" id="email" value="${company.email}" class="required form_input_align" readonly title="Ingrese Email" maxlength="40" placeholder="name@example.com"/>
			                    </div>
			                    <div style="clear:both;">
					                <label class="form_align30" >Email2: </label>
					                <input type="text" name="emailRef" id="emailRef" value="${company.email2}" class="required form_input_align" readonly title="Ingrese Email" maxlength="40" placeholder="name@example.com"/>
			                    </div>
			                    <div style="clear:both;">
					                <label class="form_align30" >Sitio Web: </label>
					                <input type="text" name="website" id="website" value="${company.website}" class="required form_input_align" readonly title="Ingrese Su Sitio Web" maxlength="40" placeholder="https://example"/>
			                    </div>
			                    <div style="clear:both;">
								    <label class="form_align30" >Fecha de Creacion :</label>
									<c:set var="dayPartsFechaIni" value="${fn:split(company.dateCreation,'-')}" />
			                        <c:set var="TemdayPartsFechaIni" value="${dayPartsFechaIni[2]}/${dayPartsFechaIni[1]}/${dayPartsFechaIni[0]}" />
								    <input  class="required form_input_align" type="text" name="birthdate" id="param_2" value="${TemdayPartsFechaIni}" readonly />	
	  
							    </div>
							   	<br/><br/>
							    <div style="clear: both">
									<label class="form_align30">&nbsp;</label>
		                    		<input type="button" value="Modificar" onclick="editCompanyPharmacy('${company.pharmacyId}')" class="botonRep" title="<fmt:message key="onclick.edit"/> ${company.name}"/>
								</div> 	  
                       		</c:forEach>
							</form>
							<div align="center">

			            	 	<table style="width: 60%">
			                 	<thead>
			                    	<tr>
			                        	<th class="th_decorado" style="width: 20%;">Nombre</th>
			                            <th class="th_decorado" style="width: 57%;">Imag&eacute;n</th>
			                        </tr>
			                     </thead>
			                     
			                     <c:forEach var="companyImage" items="${ActivePharmacy}">
			                     <tbody>
			                     	<tr>
			                        	<td style="border-left: 1px solid #c0c0c0;border-bottom: 1px solid #c0c0c0;"><b>&nbsp;Logo &nbsp;Empresa :</b></td>
			                        	
			                        	<c:choose>
											<c:when test="${companyImage.mainImage != null}">
												<td style="text-align: center;border-left: 1px solid #c0c0c0;border-right: 1px solid #c0c0c0;border-bottom: 1px solid #c0c0c0;"><img src="<c:url value="/resources/imageCompany/${companyImage.mainImage}"/>" border="1"/></td>
											</c:when>
											<c:otherwise>
												<td style="text-align: center;border-left: 1px solid #c0c0c0;border-right: 1px solid #c0c0c0;border-bottom: 1px solid #c0c0c0;"><img src="<c:url value="/resources/imageCompany/logo.png"/>" border="1"/></td>
											</c:otherwise>
										</c:choose>
			                        </tr>
			                          
			                        <tr>
			                            <td style="border-left: 1px solid #c0c0c0;border-bottom: 1px solid #c0c0c0;"><b>&nbsp;Logo &nbsp;Reporte :</b></td>
			                            <c:choose>
											<c:when test="${companyImage.reportLogo != null}">
												<td style="text-align: center;border-left: 1px solid #c0c0c0;border-right: 1px solid #c0c0c0;border-bottom: 1px solid #c0c0c0;"><img src="<c:url value="/resources/imageCompany/${companyImage.reportLogo}"/>" border="1"/></td>
											</c:when>
											<c:otherwise>
												<td style="text-align: center;border-left: 1px solid #c0c0c0;border-right: 1px solid #c0c0c0;border-bottom: 1px solid #c0c0c0;"><img src="<c:url value="/resources/imageCompany/reporte.png"/>" border="1"/></td>
											</c:otherwise>
										</c:choose>
			                            
			                        </tr>
			                        
			                        <tr >
			                            <td style="border-left: 1px solid #c0c0c0;border-bottom: 1px solid #c0c0c0;"><b>&nbsp;Logo &nbsp;Factura&nbsp; :</b></td>
			                            <c:choose>
											<c:when test="${companyImage.logo != null}">
												<td style="text-align: center;border-left: 1px solid #c0c0c0;border-right: 1px solid #c0c0c0;border-bottom: 1px solid #c0c0c0;"><img src="<c:url value="/resources/imageCompany/${companyImage.logo}"/>" border="1"/></td>
											</c:when>
											<c:otherwise>
												<td style="text-align: center;border-left: 1px solid #c0c0c0;border-right: 1px solid #c0c0c0;border-bottom: 1px solid #c0c0c0;"><img src="<c:url value="/resources/imageCompany/logo.png"/>" border="1" /></td>
											</c:otherwise>
										</c:choose>
			                                    
			                        </tr>
			                     </tbody>
			                     </c:forEach>
			                  </table>
			            	<br/>&nbsp;<br/><br/>&nbsp;<br/><br/>&nbsp;<br/>
			            	
			        	</div>
					</div>   
			                
                    </div><!--end of leftPan-->
                    
                    <div class="yDer" style="border: 1px solid #ccc;">
                        <%@include file="../../../notices.jsp" %>                       
                    </div><!--end of rightPan-->
                    
                </div><!--end of content-wrapper-->
            </div><!--end of body-wrap-->
            
            <!-- footer -->
        </div>
    </body>
</html>